# -*- coding:utf-8 -*-
import pytest
from selenium import webdriver
import allure
import pytest_ordering

from pages.login import Login
from handle.handle_log import log
from pages.project_manage import ProjectManage


class TestProjectManage(object):

    def setup_class(self):
        self.driver = webdriver.Chrome()
        self.url = "http://gshq.jianyitong.com/#/entrance/login"
        Login(self.driver, self.url).login()


    def teardown_class(self):
        self.driver.quit()

    @pytest.mark.run(order=2)
    @allure.title("新建项目")
    def testcreatproject(self):
        crp = ProjectManage(self.driver)
        text_out, text = crp.create_new_project()
        assert text_out == "项目已存在，请重创建项目！"